package com.example.server;

import com.example.api.api.IUserService;
import com.example.server.api.OtherUserService;
import com.example.server.server.RpcServer;
import lombok.extern.slf4j.Slf4j;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author heyuduo
 * @date 2022/6/18 16:37
 */
@Slf4j
public class ServerBootStrap {

    public static void main(String[] args) {
        // 注册中心
        Map<String, Object> registCenter = new HashMap<>(16, 1);
        // 实例构建
        IUserService userService = new OtherUserService();
        // 实例注册
        registCenter.put(IUserService.class.getName(), userService);
        RpcServer rpcServer = new RpcServer();
        log.info("[{}] 服务端发布对外服务【IUserService】", LocalDateTime.now());
        System.out.println(12345);
        System.out.println(12345);
        rpcServer.publishServer(registCenter, 8888);
    }
}
